﻿using Knight.Web.Infrastructure.Menus;
using Knight.Models.Base;
using Knight.Models.Services;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Security;

namespace WebApp.Areas.Manage.Controllers
{
    public class HomeController : BaseAdminController
    {
        [MallAdminMenu("Home")]
        public ActionResult Index()
        {
            ViewBag.Model = GetUser();
            ViewBag.Setting = new DbSettingApi().GetSertting<SysSetting>();
            if (ViewBag.Model == null)
            {
                Session.Abandon();
                //删除Forms验证票证
                FormsAuthentication.SignOut();
                return RedirectToAction("Login", "Account");
            }
            return View();
        }
        public ActionResult Default()
        {
            return View();
        }
    }
}